#ifndef _CPLAYER_H
#define _CPLAYER_H

#include "CCharacter.h"
#include "windows.h"
#include "CMob.h"

class CMob;

class CPlayer : public CCharacter
{
public:
	//--------------------------------------------//
	//	Constructor and Destructor for this class //
	//--------------------------------------------//
	CPlayer();
	CPlayer( float Xpos , float Ypos , float deep , float XVelocity , float YVelocity , int width , int height );
	virtual ~CPlayer();

	//-------------------------//
	//	Enum : ANIMATION_STATE //
	//-------------------------//
	enum ANIMATION_STATE { ANIMATION_STATE_STAND = 0 , 
							ANIMATION_STATE_WALK = 1 ,
							ANIMATION_STATE_JUMP = 2 ,
							ANIMATION_STATE_FALL = 3 ,
							ANIMATION_STATE_LAND = 4 ,
							ANIMATION_STATE_SLASH = 5 ,
							ANIMATION_STATE_SECOND_SLASH = 6 ,
							ANIMATION_STATE_FINAL_SLASH = 7 ,
							ANIMATION_STATE_END_SLASH = 8 ,
							ANIMATION_STATE_DASH = 9 ,
							ANIMATION_STATE_END_DASH = 10 ,
							ANIMATION_STATE_HURT = 11 ,
							NUM_OF_ANIMATION = 12 };

	

	//--------------------------------//
	//	Pulbic methods for this class //
	//--------------------------------//
	void				Init				( LPCTSTR DefineFile );
	void				SetState			( ANIMATION_STATE state );
	void				ChangeState			( ANIMATION_STATE nextState );
	void				Standing			( );
	void				Moving				( float deltaTime , DIRECTION dir );
	void				Dashing				( float deltaTime );
	void				Jumping				( );
	void				Falling				( );
	void				Landing				( );
	void				Slashing			( );
	void				EndDash				( );
	void				Hurt				( CCharacter *pCharacter );
	ANIMATION_STATE		GetState			( );
	float				GetFixedXPos		( );

	void				Update				( float deltaTime );
	RECT				GetBoundBox			( );
	bool				IsCollision			( CObject* pObject );
	int					DamageCal			( );

	static bool			Active				( CMob* pMob , LPVOID pContext );
private:
	//---------------------------------//
	//	Private methods for this class //
	//---------------------------------//
	ANIMATION_STATE			 m_CurrState;
	int						 m_nNumSlash;
	int						 m_nAmountTime;
	float					 m_fFixedPos;
	float					 m_fJumpTime;
	float					 m_fMaxJumpTime;
	float					 m_fDashTime;
	float					 m_fMaxDashTime;
	float					 m_fInvulnerableTime;
	float					 m_fMaxInvulTime;
	float					 m_fAlpha;
	bool					 m_isJump;
	bool					 m_isDash;
	bool					 m_isMove;
	CUSTOM_BOUND_BOX		 m_DashBoundBoxOffset;
	CUSTOM_BOUND_BOX		*m_SlashBoundBox;
	ULONG					 m_nSlashBoundBoxCount;

	//----------------------------------//
	//	Private methods for this class	//
	//----------------------------------//
	void			UpdateHurt				( float deltaTime );
	void			UpdateSlash				( );
	void			MoveSlashBoundBox		( bool isOriginal = true );
	RECT			GetSlashBoundBox		( );
};


#endif
